package com.tencent.albert.weixin.driver.utils;

/**
 * Created by albertzhu on 15/2/13.
 */
public class Test {
    public static void main(String[] args) {
        String temp = "<xml><ToUserName><![CDATA[gh_78d3572c4f80]]></ToUserName>\n" +
                "<FromUserName><![CDATA[oKsEQuEerHMdwU3VvKyK7bgxe6pU]]></FromUserName>\n" +
                "<CreateTime>1423814195</CreateTime>\n" +
                "<MsgType><![CDATA[text]]></MsgType>\n" +
                "<Content><![CDATA[从 v]]></Content>\n" +
                "<MsgId>6115235403373472005</MsgId>\n" +
                "</xml>";
        String head = "<MsgType><![CDATA[";
        int msgTypeStatPoint = temp.indexOf(head)+head.length();
        int msgTypeEndPoint = temp.indexOf("]]></MsgType>",msgTypeStatPoint);
        String msgType = temp.substring(msgTypeStatPoint,msgTypeEndPoint);
        System.out.println(msgType);
    }
}
